<?php

namespace app\api\model\music;

use app\logic\model\music\MusicCommentLogicModel;

class MusicCommentApiModel extends MusicCommentLogicModel
{

    function getApiList($goods_id,$type,$page = 1,$limit =1){
        $query = $this->where('goods_id',$goods_id)
            ->field('user_id,content,create_time')
            ->withJoin(['user'=>['nickname','head_img']])
            ->where('type',$type)
            ->where('audit',20);
        $list =$query->page($page,$limit)
            ->select();
        $count = $query->count();
        return [$list,$count];
    }
}